package com.ssd.controller;

import com.ssd.entity.PolicyEntity;
import com.ssd.service.PolicyService;
import com.ssd.view.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/policy")
@Slf4j
public class PolicyController {

    @Resource
    private PolicyService policyService;

    // 分页查询商品列表
    @GetMapping("/list")
    public BaseResponse<List<PolicyEntity>> getPolicyPage(
            @RequestParam(defaultValue = "1") int pageNum,
            @RequestParam(defaultValue = "10000") int pageSize) {
        return new BaseResponse(policyService.getPolicyList(pageNum, pageSize));
    }
}